home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMTEX / SOURCES1 / !TeX / texmf / source / armTeX / lib / h / riscos_ex < prev    next >
Encoding:
Text File  |  1998-04-04  |  3.7 KB  |  106 lines

  1. /*
  2.  * riscos_ex.c: RISC OS extras
  3.  * 
  4.  * Copyright (C) 1992 Free Software Foundation, Inc.
  5.  * 
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published
  8.  * by the Free Software Foundation; either version 2, or (at your
  9.  * option) any later version.
  10.  * 
  11.  * This program is distributed in the hope that it will be useful, but
  12.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * General Public License for more details.
  15.  * 
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  * 
  20.  * This file contains functions that are lacking in Acorn ANSI C v4 or
  21.  * that are too RISC OS-specific to be simply changed in the relevant
  22.  * .c or .h files
  23.  * 
  24.  * All functions are prefixed by `riscos_' to avoid function name
  25.  * clashes
  26.  * 
  27.  * The author is Mark J. Sinke, reachable at marks@stack.urc.tue.nl or
  28.  * Mark J. Sinke Mendelssohnstraat 5 5144 GD WAALWIJK The Netherlands
  29.  */
  30.  
  31. #ifndef RISCOS_EX_H
  32. #define RISCOS_EX_H
  33.  
  34. /* riscos_absolute(name): return true if `name' has an absolute path */
  35. boolean riscos_absolute (char *name);
  36.  
  37. /* riscossetname(name): set name of `current path' */
  38. void riscossetname (char *name);
  39.  
  40. /* riscos_isdir(filename): return true if filename is a directory */
  41. boolean riscos_isdir (char *filename);
  42.  
  43. /* riscos_samefile(file1, file2): return true if files are the same */
  44. boolean riscos_samefile (char *file1, char *file2);
  45.  
  46. #ifndef RISCOS_EX_C_FILE    /* Avoid circular references */
  47. /*
  48.  * riscos_fopen(filename, mode): open a file for output, possibly
  49.  * creating a directory and dealing with '@'
  50.  */
  51. FILE *riscos_fopen (char *filename, char *mode);
  52. #define fopen(a,b) riscos_fopen(a,b)
  53. #endif /* RISC OS C File */
  54.  
  55. /* All of these filetypes are registered */
  56. #define riscosdvitype   0xce4
  57. #define riscostextype   0xce5 /* was 0x2a7 */
  58. #define riscoslatextype 0xaca /* was 0x2a8 */
  59. #define riscosmftype    0xca0 /* was 0x2a9 */
  60. #define riscosgftype    0xca2 /* was 0x2aa */
  61. #define riscospktype    0xca3 /* was 0x2ab */
  62. #define riscostfmtype   0xca1 /* was 0x2ac */
  63. #define riscosvftype    0xac9
  64. #define riscosdumptype  0xffd /* data type for memory dumps */
  65.  
  66. extern int riscostype;        /* file type for next file to be
  67.                  * opened for output */
  68.  
  69. /* Extensions by Jakob Stoklund Olesen */
  70.  
  71. extern char *current_prefix;    /* current path prefix */
  72. extern int current_prefix_length;    /* and its length */
  73.  
  74. /*
  75.  * All the filename translation for RISC OS is handled by this function.
  76.  * The current prefix is prepended to the path is necessary and the
  77.  * extension delimiter is swapped between '.' and '/'. If create is true,
  78.  * an empty file of type riscostype is created and possibly the necessary
  79.  * directory. The string returned is malloc'ed and should be freed after use.
  80.  */
  81.  
  82. extern char *riscos_translate (char *filename, boolean create);
  83.  
  84. /*
  85.  * TeX and Metafont have two ways of creating output files with
  86.  * extensions: dot-mode: file is put in a directory. slash-mode:
  87.  * extension separator is '/'. The mode is determined by the filename
  88.  * conventions used by the input file.
  89.  * 
  90.  * The calling program should set riscosoutputmode to -1 if it is
  91.  * negative and the program is about to read the file that determines
  92.  * the output mode.
  93.  */
  94. extern enum riscosoutputmode_enum
  95.   {
  96.     outputmode_setnextread = -1,    /* Set mode from filename of next
  97.                      * sucessful openin */
  98.     outputmode_unset = -2,    /* The output mode has not yet been
  99.                  * determined */
  100.     outputmode_dot = 1,        /* use '.' filenames */
  101.     outputmode_slash = 2    /* use '/' names */
  102.   }
  103. riscosoutputmode;
  104.  
  105. #endif /* RISCOS_EX_H */
  106.